package com.bm.specialvehiclefordispatcher.activity.mywallet;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.bm.specialvehiclefordispatcher.R;
import com.bm.specialvehiclefordispatcher.activity.BaseActivity;
import com.bm.specialvehiclefordispatcher.activity.mine.MyOrderActivity;
import com.bm.specialvehiclefordispatcher.views.CommonNavigationBar;

/**
 * @Copyright Copyright 2014 蓝色互动. All rights reserved.
 * 
 * @author GuoHao
 * @Date: 2015年8月27日 充值结果
 */
public class RechargeResult extends BaseActivity {

	CommonNavigationBar bar;
	int type;
	ImageView rechargeresult_img;
	TextView rechargeresult_text;
	Button rechargeresult_seeorder;
	Button rechargeresult_gorecharge;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_rechargeresult);
		findViews();
		init();
		addListeners();
	}

	@Override
	public void findViews() {

		bar = (CommonNavigationBar) findViewById(R.id.navi);
		bar.setListener(null);
		rechargeresult_img = (ImageView) findViewById(R.id.rechargeresult_img);
		rechargeresult_text = (TextView) findViewById(R.id.rechargeresult_text);
		rechargeresult_seeorder = (Button) findViewById(R.id.rechargeresult_seeorder);
		rechargeresult_gorecharge = (Button) findViewById(R.id.rechargeresult_gorecharge);

	}

	@Override
	public void init() {
		if (type == -1) {
			bar.setTitle("充值失败");
			rechargeresult_img.setBackgroundResource(R.drawable.result_no);
			rechargeresult_text.setText("充值失败");
			rechargeresult_seeorder.setText("查看订单");
			rechargeresult_gorecharge.setText("重新充值");
		} else {
			bar.setTitle("充值成功");
			rechargeresult_img.setBackgroundResource(R.drawable.result_ok);
			rechargeresult_text.setText("充值成功");
			rechargeresult_seeorder.setText("查看订单");
			rechargeresult_gorecharge.setText("继续充值");
		}

	}

	@Override
	public void addListeners() {
		rechargeresult_seeorder.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(mActivity, MyOrderActivity.class));
			}
		});
		rechargeresult_gorecharge.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(mActivity, RechargeMoneyActivity.class));
			}
		});
	}

}
